<?php
return [
    'templatePath' => APP_PATH . '/resource/view',
    'templateCachePath' => APP_PATH . '/storage/framework/cache',
    'mysql' => [
        'host' => my_env('MYSQL_HOST', '127.0.0.1'),
        'database' => my_env('MYSQL_DATABASE', 'database'),
        'username' => my_env('MYSQL_USER', 'root'),
        'password' => my_env('MYSQL_PWD', ''),
        'charset' => my_env('MYSQL_CHARSET', 'utf8'),
        'collation' => my_env('MYSQL_COLLATION', 'utf8_unicode_ci'),
        'prefix' => my_env('MYSQL_PREFIX', ''),
        'port' => my_env('MYSQL_PORT', 3306),
        'worker_connection_length' => 64,
    ],
    'webSocket' => [
        [
            'address' => '0.0.0.0',
            'port' => 9502,
            'controller' => \App\WebSocketController\Controller::class
        ],
        [
            'address' => '0.0.0.0',
            'port' => 9503,
            'controller' => \App\WebSocketController\Controller::class
        ],
    ],

    'queue' => [
        'send_mail_queue' => DI\create(\App\MessageQueue\SendMail::class)
    ],

    'delay_queue' => [
        'miaosha' => DI\create(\App\MessageQueue\SendMail::class)
    ],
    /**
     * 中间件配置
     *  middleware下面的key对应群组路由的prefix,如果出现同名，则以最上级的为主，应尽量避免
     *  key对应的数组，是该群组的中间件
     */
    /**
     * IOC模式正确设置方法  $response = self::$container->call([$val,'handle']);
     \DI\create(\App\Middleware\LoginMiddleware::class)->method('handle', \DI\get(\Asf\Http\Request::class), \DI\get(\Asf\Database\RedisPool::class)),
     */
    'middleware' => [
        '/test' => [
            \App\Middleware\LoginMiddleware::class,
            \App\Middleware\CurrentLimit::class
        ],
    ],
];